﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ThreadFrameTest
{
    class Program
    {

        public delegate string FuncTest(string str);

        static void Main(string[] args)
        {
            Func<string, string> ss = (string str) =>
            {
                Thread.Sleep(1000);
                return str;
            };

            ss.BeginInvoke("tst", (x) =>
            {
                var s = ss.EndInvoke(x);
                Console.WriteLine(s);
            }, "");


            //FuncTest funcTest = new FuncTest(TestStr);
            //funcTest.BeginInvoke("test", (x) =>
            //{
            //    var s = funcTest.EndInvoke(x);
            //    Console.WriteLine(s);
            //},null);
            Console.WriteLine("测试");
            Console.ReadKey();
        }


        public static  string TestStr(string str)
        {
            Thread.Sleep(1000);
            return str;
        }
    }
}
